<template>
  <view class="page">
    <view class="title">
      <text>管理平台</text>
      <text>移动物业管理平台</text>
    </view>
    <button class="btn_login" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
      登录
    </button>
    <button class="btn_login" open-type="share">
      分享
    </button>
  </view>
</template>

<script>
  import {
    getOpenIdApi,
  } from "@/api/login.js";
  import host from '@/utils/ipConfig.js'
  import { mapActions } from 'vuex'
  export default {
    data() {
      return {
        isLoading: false,
        markers:[{
          id:1,
          longitude:121.346635,
          latitude:31.137819,
          title:'123'
        }],
      }
    },
    onShareAppMessage() {
      return {
        title:'牵手婚礼',
        path:'pages/index/index'
      }
    },
    onLoad() {
      uni.showLoading({
        mask: true,
        title: '初始化中'
      })
      const hasOpenid = uni.getStorageSync('openid')
      if(hasOpenid){
        uni.redirectTo({
          url: '/pages/index/index'
        })
      }
      setTimeout(() => {
        uni.hideLoading()
      }, 1000)
    },
    methods: {
      ...mapActions(['setBusinessInfo']),
      handleShare(){
        wx.showShareMenu({
          withShareTicket:true,
          menus:['shareAppMessage', 'shareTimeline']
        })
      },
      getPhoneNumber(val) {
        const _this = this;

      }
    }
  }
</script>

<style lang="scss" scoped>
</style>
